import { getMedicineOrderDetailAPI } from '@/api/order'
import type { MedicineOrderDetail } from '@/types/order'
import { ref } from 'vue'

// 查看订单详情
export const useOrderDetail = (orderId: string) => {
  const orderDetail = ref<MedicineOrderDetail>()

  // 获取订单详情
  const getOrderDetail = async () => {
    if (!orderId) return
    const res = await getMedicineOrderDetailAPI(orderId)
    orderDetail.value = res
    console.log(res)
  }
  getOrderDetail()

  

  return { orderDetail }
}
